package com.example.demotest.pojo.dto;

import jakarta.persistence.Column;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.util.List;

@Data
public class UserDto {

    private Integer userID;

    @NotBlank(message = "用户名不能为空")
    private String userName;

    @NotBlank(message = "密码不能为空")
    @Length(min = 6, max = 12)
    private String password;

    @NotBlank(message = "昵称不能为空")
    private String nickname;

    private String avatarUrl;

    public String getAvatarUrl() {
        return avatarUrl;
    }

    public void setAvatarUrl(String avatarUrl) {
        this.avatarUrl = avatarUrl;
    }

    public @NotBlank(message = "用户名不能为空") String getUserName() {
        return userName;
    }

    public void setUserName(@NotBlank(message = "用户名不能为空") String userName) {
        this.userName = userName;
    }

    public @NotBlank(message = "密码不能为空") @Length(min = 6, max = 12) String getPassword() {
        return password;
    }

    public void setPassword(@NotBlank(message = "密码不能为空") @Length(min = 6, max = 12) String password) {
        this.password = password;
    }

    public Integer getUserID() {
        return userID;
    }

    public void setUserID(Integer userID) {
        this.userID = userID;
    }

    public @NotBlank(message = "昵称不能为空") String getNickname() {
        return nickname;
    }

    public void setNickname(@NotBlank(message = "昵称不能为空") String nickname) {
        this.nickname = nickname;
    }

    @Override
    public String toString() {
        return "UserDto{" +
                "userID=" + userID +
                ", userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", nickname='" + nickname + '\'' +
                ", avatarUrl='" + avatarUrl + '\'' +
                '}';
    }
}
